package com.kookapi.business.service.impl;

import java.util.List;
import com.kookapi.common.utils.DateUtils;
import com.kookapi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.kookapi.business.mapper.TestScenarioDataMapper;
import com.kookapi.business.domain.TestScenarioData;
import com.kookapi.business.service.ITestScenarioDataService;

/**
 * 场景参数数据Service业务层处理
 * 
 * @author cleftgou
 * @date 2025-10-06
 */
@Service
public class TestScenarioDataServiceImpl implements ITestScenarioDataService 
{
    @Autowired
    private TestScenarioDataMapper testScenarioDataMapper;

    /**
     * 查询场景参数数据
     * 
     * @param id 场景参数数据主键
     * @return 场景参数数据
     */
    @Override
    public TestScenarioData selectTestScenarioDataById(Long id)
    {
        return testScenarioDataMapper.selectTestScenarioDataById(id);
    }

    /**
     * 查询场景参数数据列表
     * 
     * @param testScenarioData 场景参数数据
     * @return 场景参数数据
     */
    @Override
    public List<TestScenarioData> selectTestScenarioDataList(TestScenarioData testScenarioData)
    {
        return testScenarioDataMapper.selectTestScenarioDataList(testScenarioData);
    }

    /**
     * 新增场景参数数据
     * 
     * @param testScenarioData 场景参数数据
     * @return 结果
     */
    @Override
    public int insertTestScenarioData(TestScenarioData testScenarioData)
    {
        testScenarioData.setCreateTime(DateUtils.getNowDate());
        testScenarioData.setCreateBy(SecurityUtils.getUsername());
        return testScenarioDataMapper.insertTestScenarioData(testScenarioData);
    }

    /**
     * 修改场景参数数据
     * 
     * @param testScenarioData 场景参数数据
     * @return 结果
     */
    @Override
    public int updateTestScenarioData(TestScenarioData testScenarioData)
    {
        testScenarioData.setUpdateTime(DateUtils.getNowDate());
        testScenarioData.setUpdateBy(SecurityUtils.getUsername());
        return testScenarioDataMapper.updateTestScenarioData(testScenarioData);
    }

    /**
     * 批量删除场景参数数据
     * 
     * @param ids 需要删除的场景参数数据主键
     * @return 结果
     */
    @Override
    public int deleteTestScenarioDataByIds(Long[] ids)
    {
        return testScenarioDataMapper.deleteTestScenarioDataByIds(ids);
    }

    /**
     * 删除场景参数数据信息
     * 
     * @param id 场景参数数据主键
     * @return 结果
     */
    @Override
    public int deleteTestScenarioDataById(Long id)
    {
        return testScenarioDataMapper.deleteTestScenarioDataById(id);
    }
}
